package com.example.testactivity0316;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class SecondActivity2 extends AppCompatActivity {
    public Button back2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second2);
        initView();//记得调用
    }



    public void initView(){
    back2=findViewById(R.id.back2);
        back2.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
            //Intent intent = new Intent(SecondActivity2.this,MainActivity.class);
            //startActivity(intent);
        }
    });


}}